Component({
  properties: {
    visible: {
      type: Boolean,
      value: false,
    },
  },
  data: {
    cityList: ["北京", "上海", "广州", "深圳", "杭州", "成都", "武汉", "西安", "重庆", "南京"],
  },
  methods: {
    closePicker() {
      this.setData({ visible: false });
    },
    selectCity(e) {
      const city = e.currentTarget.dataset.name;
      this.triggerEvent("onCitySelected", { city });
      this.closePicker();
    },
  },
});
